package com.sk.cardeal.act.manage.act;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.dyhdyh.widget.loading.dialog.LoadingDialog;
import com.sk.cardeal.R;
import com.sk.cardeal.base.BaseActivity;
import com.sk.cardeal.callback.HandleDataCallBack;
import com.sk.cardeal.utils.AppApi;
import com.sk.cardeal.utils.MyUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by sunke on 2018/2/27.
 */

public class OutActivity extends BaseActivity implements HandleDataCallBack {
    @BindView(R.id.back)
    ImageView back;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.icon)
    ImageView icon;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.data_ryc)
    RecyclerView dataRyc;
    @BindView(R.id.sure_out)
    TextView sureOut;

    private String code;
    private LoadingDialog loadingDialog;

    @Override
    protected int getContentView() {
        return R.layout.activity_out;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        loadingDialog = MyUtils.getLoadingDialog(mContext, false);

        code = getIntent().getStringExtra("code");
        loadingDialog.show();
        AppApi.getOutOrderDetails(code, this, 0, this);
    }

    @OnClick({R.id.back, R.id.icon, R.id.tv_time, R.id.sure_out})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.icon:
                break;
            case R.id.tv_time:
                break;
            case R.id.sure_out:
                break;
        }
    }

    @Override
    public void handlerSuccessData(String result, int tag) {
        loadingDialog.cancelDialog();
    }

    @Override
    public void handlerFailData(String failString, int tag) {
        loadingDialog.cancelDialog();
    }

    @Override
    public void handleErrorData(String error, int tag) {
        loadingDialog.cancelDialog();
    }
}
